#!/bin/bash

function checkresult()
{
    if [ $? != "0" ]; then
        exit;
    fi
}

echo "Compiling the library..."
make dep > /dev/null
make $* > /dev/null
checkresult

echo "Compiling the unittest..."
cd source/cpp/unittest
make dep > /dev/null
make $* > /dev/null
checkresult

echo "Running the unittest..."
./UnitTest.sh
checkresult

echo "DONE!"
